import MessageBox from './components/MessageBox.vue'
import Vue from "vue"
export function showMsg(msg = '', type = 'success', duration = 2000) {
  const dashboardMain = document.getElementById('dashboardMain')
  if(!dashboardMain){
    return false
  }
  const msgDiv = document.createElement('div')
  dashboardMain.appendChild(msgDiv)


  const MsgComp = Vue.extend(MessageBox)
  const comp = new MsgComp({
    propsData: {
      msg,type,duration
    }
  }).$mount(msgDiv)
}
